package com.bw.controller;

import com.bw.domain.GoodsType;
import com.bw.service.GoodsTypeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;
//商品分类查询
@Controller
public class GoodsTypeController {

    @Autowired
    GoodsTypeService goodsTypeService;

    //根据pid 查询所有的分类
    @ResponseBody
    @RequestMapping("listTypeByPid")
    public List<GoodsType> listTypeByPid(Integer pid){

        return goodsTypeService.lists(pid);
    }

}
